<template>
  <el-popconfirm
    confirm-button-text="确认"
    cancel-button-text="取消"
    :icon="icon"
    :icon-color="iconColor"
    :title="title"
    @onConfirm="onConfirm"
  >
    <el-button slot="reference" type="text" size="small" style="margin-left:5px;">{{ buttonText }}</el-button>
  </el-popconfirm>
</template>

<script>
export default {
  props: {
    iconColor: {
      type: String,
      default: 'red'
    },
    icon: {
      type: String,
      default: 'el-icon-info'
    },
    title: {
      type: String,
      default: '是否确认删除该条数据？'
    },
    buttonText: {
      type: String,
      default: '删除'
    }
  },
  methods: {
    onConfirm() {
      this.$emit('onConfirm')
    }
  }
}
</script>

<style lang="sass" scoped>

</style>
